// pages/history/history.js

const app = getApp();

Page({

    /**
     * 页面的初始数据
     */
    data: {
        history: [],
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        wx.cloud.callFunction({
            name: 'history',
            data: {
                type: 'selectRecord',
                openid: app.globalData.openid
            }
        }).then((res) => {
            console.log("history:", res.result.data[0].history)
            this.setData({
                history: res.result.data[0].history
            })
        })
    },

    onTapReLaunch: function (e) {
        console.log("data-set:", e.currentTarget.dataset)
        let url = `/pages/index/index?query=${e.currentTarget.dataset.query}`
        wx.reLaunch({
            url
        })
    }
})